from dataclasses import dataclass


@dataclass
class Test:
    num: int = 0
    get_num: any = None
    set_num: any = None


def test_get_num(this):
    return this.num


def test_set_num(this, num):
    this.num = num


t = Test(10, get_num=test_get_num, set_num=test_set_num)
print(t.get_num(t))
t.set_num(t, 20)
print(t.get_num(t))
